import React, {Component} from 'react';
import PropTypes from 'prop-types';

export default class TextBlock extends Component {
  static propTypes = {
    text: PropTypes.string,
    onChange: PropTypes.func,
  }

  handleChange = (e) => {
    this.props.onChange && this.props.onChange(e.target.value);
  }

  render() {
    return <textarea rows="6" value={this.props.text} onChange={this.handleChange} />;
  }
}
